home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
powervww
/
pvdrv.h
< prev
next >
Wrap
C/C++ Source or Header
|
1998-01-05
|
18KB
|
583 lines
// ____________________________________________________
// | |
// | Project: POWER VIEW INTERFACE |
// | File: PVDRV.H |
// | Compiler: WPP386 (10.6) |
// | |
// | Subject: Drivers interface |
// | |
// | Author: Emil Dotchevski |
// |____________________________________________________|
//
// E-mail: zajo@geocities.com
// URL: http://www.geocities.com/SiliconValley/Bay/3577
void __init_drivers( void );
void hook_drivers( void );
void unhook_drivers( void );
#ifndef PVDRV_H
#define PVDRV_H
//EVENTS DEFINES
#define MAX_EVENTS 64 //events queue max length
//hardware events codes
#define evNOTHING 0x0000 //no event pending
#ifndef NOMOUSE
#define evMOUSE_DOWN 0x0001 //mouse button pressed
#define evMOUSE_UP 0x0002 //mouse button depressed
#define evMOUSE_REP 0x0004 //mouse button auto repeat
#define evMOUSE_MOVE 0x0008 //mouse moved
#define evMOUSE_DRAG 0x0010 //mouse moved w/ button down
#define evMOUSE evMOUSE_DOWN+evMOUSE_UP+evMOUSE_REP+evMOUSE_MOVE+evMOUSE_DRAG
#ifdef HGR
#define evMOUSE_HGR_MOVE 0x1000 //mouse moved one pixel
#define evMOUSE_HGR_DRAG 0x2000 //mouse draged one pixel
#define evHGR_MOUSE evMOUSE_DOWN+evMOUSE_UP+evMOUSE_REP+evMOUSE_HGR_MOVE+evMOUSE_HGR_DRAG
#endif
#endif
#define evKEY_PRESS 0x0020 //ascii char
#define evKEY_DOWN 0x0040 //key down (short 9)
#define evKEY_UP 0x0080 //key up (short 9)
#define evKEYBOARD evKEY_PRESS+evKEY_DOWN+evKEY_UP
#define evCOMMAND 0x0100 //internal command
//events priorities
#ifndef NOMOUSE
#define epMOUSE_DOWN 0x1000 //mouse button pressed
#define epMOUSE_UP 0x1000 //mouse button depressed
#define epMOUSE_REP 0x1000 //mouse button auto repeat
#define epMOUSE_MOVE 0x1000 //mouse moved
#define epMOUSE_DRAG 0x1000 //mouse moved w/ button down
#endif
#define epKEY_DOWN 0x2000 //key down (short 9)
#define epKEY_PRESS 0x2000 //ascii char
#define epKEY_UP 0x2000 //key up (short 9)
struct Tevent
{
uint priority;
void *destination;
uint code;
union
{
struct
{
unsigned long time_passed;
} idle;
#ifndef NOMOUSE
struct
{
int local_x; //owner-based local x
int local_y; //owner-based local y
int local_hgr_x; //owner-based local x
int local_hgr_y; //owner-based local y
boolean inside; //mouse in the object
int global_x; //screen-based x
int global_y; //screen-based y
int global_hgr_x; //screen-based x
int global_hgr_y; //screen-based y
char button; //btn number (0,1,2)
char buttons; //buttons status
char clicks; //fast-clicks number
} mouse;
#endif
struct
{
char scan_code; //k'board scan code
boolean ext_key; //101-k'board key
uint ascii; //extended ASCII code
} keyboard;
struct
{
uint cmd_code; //internal cmd code
void *cmd_info; //pointer to the info
uint cmd_size; //info size
} command;
} what;
};
#define TIME_PASSED what.idle.time_passed
#ifndef NOMOUSE
#define LOCAL_X what.mouse.local_x
#define LOCAL_Y what.mouse.local_y
#define LOCAL_HGR_X what.mouse.local_hgr_x
#define LOCAL_HGR_Y what.mouse.local_hgr_y
#define INSIDE what.mouse.inside
#define GLOBAL_X what.mouse.global_x
#define GLOBAL_Y what.mouse.global_y
#define GLOBAL_HGR_X what.mouse.global_hgr_x
#define GLOBAL_HGR_Y what.mouse.global_hgr_y
#define BUTTON what.mouse.button
#define BUTTONS what.mouse.buttons
#define CLICKS what.mouse.clicks
#endif
#define SCAN_CODE what.keyboard.scan_code
#define EXT_KEY what.keyboard.ext_key
#define ASCII what.keyboard.ascii
#define CMD_CODE what.command.cmd_code
#define CMD_INFO what.command.cmd_info
#define CMD_SIZE what.command.cmd_size
//TIMER DEFINES
typedef void ( * Tcallback ) ( void );
//KEYBOARD DEFINES
//scan codes
#define scESC 0x0001
#define sc1 0x0002
#define sc2 0x0003
#define sc3 0x0004
#define sc4 0x0005
#define sc5 0x0006
#define sc6 0x0007
#define sc7 0x0008
#define sc8 0x0009
#define sc9 0x000A
#define sc0 0x000B
#define scMINUS 0x000C //keyboard '-'
#define scEQUAL 0x000D //keyboard '='
#define scBS 0x000E //backspace
#define scTAB 0x000F
#define scQ 0x0010
#define scW 0x0011
#define scE 0x0012
#define scR 0x0013
#define scT 0x0014
#define scY 0x0015
#define scU 0x0016
#define scI 0x0017
#define scO 0x0018
#define scP 0x0019
#define scLBRACKET 0x001A //"["
#define scRBRACKET 0x001B //"]"
#define scENTER 0x001C
#define scCTRL 0x001D
#define scA 0x001E
#define scS 0x001F
#define scD 0x0020
#define scF 0x0021
#define scG 0x0022
#define scH 0x0023
#define scJ 0x0024
#define scK 0x0025
#define scL 0x0026
#define scSEMICOLON 0x0027 //";"
#define scBACK_APOST 0x0028 //"`"
#define scAPOSTROFE 0x0029 //"'"
#define scLSHIFT 0x002A //left shift
#define scBACK_SLASH 0x002B //"\"
#define scZ 0x002C
#define scX 0x002D
#define scC 0x002E
#define scV 0x002F
#define scB 0x0030
#define scN 0x0031
#define scM 0x0032
#define scCOMMA 0x0033 //","
#define scPOINT 0x0034 //"."
#define scSLASH 0x0035 //"/"
#define scRSHIFT 0x0036 //right shift
#define scPRTSC 0x0037 //print screen
#define scALT 0x0038
#define scSPACE 0x0039
#define scCAPS 0x003A
#define scF1 0x003B
#define scF2 0x003C
#define scF3 0x003D
#define scF4 0x003E
#define scF5 0x003F
#define scF6 0x0040
#define scF7 0x0041
#define scF8 0x0042
#define scF9 0x0043
#define scF10 0x0044
#define scNUM 0x0045
#define scSCROLL 0x0046
#define scHOME 0x0047
#define scUP 0x0048
#define scPGUP 0x0049
#define scGRAY_MINUS 0x004A //keypad "-"
#define scLEFT 0x004B //keypad "<-"
#define scCENTER 0x004C //keypad "5"
#define scRIGHT 0x004D //keypad "->"
#define scGRAY_PLUS 0x004E //keypad "+"
#define scEND 0x004F
#define scDOWN 0x0050
#define scPGDN 0x0051
#define scINS 0x0052
#define scDEL 0x0053
//ascii codes
#define kF1 0x3B00
#define kF2 0x3C00
#define kF3 0x3D00
#define kF4 0x3E00
#define kF5 0x3F00
#define kF6 0x4000
#define kF7 0x4100
#define kF8 0x4200
#define kF9 0x4300
#define kF10 0x4400
#define kF11 0x8500
#define kF12 0x8600
#define kTAB 0x0009
#define kCTRL_ENTER 0x1C0A
#define kSPACE 0x0020
#define kBS 0x0008
#define kESC 0x001B
#define kENTER 0x000D
#define kUP 0x4800
#define kDOWN 0x5000
#define kLEFT 0x4B00
#define kRIGHT 0x4D00
#define kPG_UP 0x4900
#define kPG_DN 0x5100
#define kHOME 0x4700
#define kEND 0x4F00
#define kINS 0x5200
#define kDEL 0x5300
//ctrl ascii codes
#define kCTRL_A 0x0001
#define kCTRL_B 0x0002
#define kCTRL_C 0x0003
#define kCTRL_D 0x0004
#define kCTRL_E 0x0005